<?php $this->load->view("pedido/listaCompra_js");?>
<form name="lista" class="form-horizontal  well" method="post" action="<?php echo base_url().'pedido/guardarListaCompra'?>" accept-charset="utf-8">
<fieldset>
<legend>Pedidos a Proveedor</legend>
<div class="container-fluid ">    
<fieldset>
<div class="row-fluid">
    <div class="span6 ">
       <button class="btn btn-mini btn-success" type="button" onclick="abrirModal('myModalPed')">Insumos de Pedidos</button> 
    </div>    
</div>

<div class="row-fluid">
    <div class="span6 ">
        <div class='control-group'> 
        <input type="hidden" name="idInsumo" id="idInsu" value="">
        <input type="hidden" name="indicador" id="indicador" value="0"> 
        <label class='control-label' for='nomIns'>Nombre Insumo* </label><div class='controls'>
        <input class='span6' id='nomIns' name='nomIns' type='text'  
        onkeyup="lookup(this.value,'nomIns')" ><button class="btn btn-mini btn-success" type="button" onclick="buscarProveedor()">Buscar Proveedor</button> </div></div>
        <div class='suggestionsBox' id='suggestions' style='display: none;'>
            <img src='<?php echo base_url().RUTA_IMAG?>upArrow.png' style='position: relative; top: -12px; left: 30px;' alt='upArrow' />
        <div class='suggestionList' id='autoSuggestionsList'></div></div>   
        <?php                
        sipcop_inputtexDoble('cant','unid', 'Cantidad','Cantidad','Unidades' ,'','',4,4,false,$active=true);          
        sipcop_inputTextSi('precio', 'Precio x Unidad Aprox', '',4, $active=true)
        ?>
    </div>
    <div class="span6 ">
        <div id="comboProveedor">
                  <div class='control-group'>
                <label class='control-label' for='trabajo'>Proveedor</label>
                <div class='controls'>
                <select ></select></div></div>
        </div> 
            <?php sipcop_textArea('desrip', 'Descripción', 3, '', $active=true, $ancho='200px')?>
                  
    </div>
</div>
    <button class="btn btn-mini btn-success" type="button" onclick="agregarFilaBoton()">Agregar Insumo</button> 
 </fieldset>
</div>
<div id="escondidos">
</div>
<div class="container-fluid ">
    <div class="row-fluid" >
    <table class="table table-bordered">
        <caption>Lista de Compras</caption>
        <thead id="tabla">
            <th>Numero</th>
            <th>Nombre Insumo</th>
            <th>Proveedor</th>
            <th>Descripcion</th>
            <th>Cantidad</th>
            <th>Precio Unidad</th>
            <th>Subtotal</th><th>Eliminar</th>
            
        </thead>
        <tbody id="insumos">
            
        </tbody>
    </table> 
   </div>
    <div class="row-fluid" >
        <div class="span6 offset7 ">
            <div class="controls-group"> 
                <label class="control-label" for="total"> Total </label>  
                 <div class="controls">
                <span class="add-on">S/.</span><input readonly="readonly" class="span6" id="total" name="total" type="text" value="0">
                </div>        
         </div>
        </div>        
    </div>
    <div class="row-fluid">
        <button class="btn  btn-success" type="submit" >Guardar</button>
        <button class="btn  btn-warning" type="button" onclick="abrirenOtraVentana('nuevaventan',lista)">Imprimir</button>
    </div>
    
</div>

</fieldset>
</form>
<?php $this->load->view("pedido/modalBuscarPedido");?>